// Copyright 2007 Google Inc.
// All Rights Reserved.

package com.google.jessewilson.codesearch.api;

import com.google.jessewilson.codesearch.api.spi.SearchProviderBackend;
import com.google.jessewilson.codesearch.api.spi.SearchProviderConfigurationEditor;
import com.google.jessewilson.codesearch.api.spi.SearchProviderParametersEditor;
import com.google.jessewilson.codesearch.configuration.SearchProviderConfiguration;

/**
 * @author Ted Mao (tmao@google.com)
 */
public abstract class SearchProvider implements SearchProviderAware {

  public abstract Class<? extends SearchProviderBackend> getBackend();
  public abstract Class<? extends SearchProviderParametersEditor> getParametersEditor();
  public abstract Class<? extends SearchProviderConfigurationEditor> getConfigurationEditor();
  public abstract Class<? extends SearchProviderConfiguration> getConfiguration();

  public abstract SearchProviderConfiguration createDefaultConfiguration();
  public abstract String getName();

  public final SearchProvider getSearchProvider() {
    return this;
  }

  @Override public final int hashCode() {
    return getClass().hashCode();
  }
  @Override public final boolean equals(Object obj) {
    return obj != null && obj.getClass() == getClass();
  }

}
